package basic

import (
	"fmt"
	"math/cmplx"
	"math"
)


var(aa = 3
 bb = 4
 kk = "kk")



func variableZeroValue(){
	var a int
	var b string
	fmt.Printf("%d %q\n",a,b)
}


func variableInitialValue(){
	var a ,b int = 3,4
	var s string = "abc"
	fmt.Println(a,b,s)
}

func variableTypeDuction(){
	var a,b,c,s = 3,4,true,"abc"
	fmt.Println(a,b,c,s)
}

func variableShorter(){
	 a,b,c,s := 3,4,true,"abc"
	fmt.Println(a,b,c,s)
}


func euler()  {
	c :=3+4i
	fmt.Println(cmplx.Abs(c))
	fmt.Println(cmplx.Exp(1i*math.Pi)+1)

}

func triangle(){
	var a ,b = 3,4
	var c int
	c = int(math.Sqrt(float64(a*a+b*b)))
	fmt.Println(c)
}


func consts(){
	const filename = "abc.txt"
	const a,b  = 3,4
	fmt.Println(filename,a,b)
}

func enumes()  {
	const(
		cpp = iota
		java
		python
		golang
	)
	fmt.Println(cpp,java,python,golang)
}

func main() {
	fmt.Println("hello world")
	variableZeroValue()
	variableInitialValue()
	variableTypeDuction()
	variableShorter()
	fmt.Println(aa,bb,kk)
	euler()
	triangle()
	consts()
	enumes()
}

